Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket modification via Upsert #152

Merged
merged 2 commits into from
Aug 14, 2020
Merged

Bucket modification via Upsert #152

merged 2 commits into from
Aug 14, 2020

Conversation

Turnerj
Copy link
Member

@Turnerj Turnerj commented Aug 14, 2020

This prevents multiple queries and large amounts of data being transferred between being the client and server. The large amounts of data being transferred messes with the performance characteristics this is meant to provide.

NOTE: This change fundamentally changes how buckets work!

  • The "Index" column dropped and now requires a DateTime-based property defined and referenced in the BucketOptionsAttribute
  • Buckets no longer have a change tracker. Buckets can be added to or they can be removed by their group

The "Index" column change was fundamentally required to keep bucket ordering without fetching the last index from the DB. For the most part, interacting with buckets generated by the old process should still work - your data would still be there. Where there would be complete incompatibility is whether your sub-entity actually has a DateTime property as that is unfortunately the only way this works. This new process follows the documentation here: https://www.mongodb.com/blog/post/time-series-data-and-mongodb-part-2-schema-design-best-practices

The "buckets no longer have a change tracker" is mostly related to switching to command staging rather than an entity collection. Additionally however, buckets aren't designed for editing existing data or removing individual items - it is designed for mass storage of small pieces of data. With the EntityBucketStagingCollection being redundant, having a collection at all (and thus a change tracker) was pointless.

If this change breaks your workflow - I recommend manually bringing in the removed EntityBucketStagingCollection and creating your own version of the MongoDbBucketSet. Yes that sucks though breaking changes like this can happen from time-to-time prior to v1.0.0 - the majority of the time however, I endeavour to avoid breaking changes for common use cases.

This prevents multiple queries and large amounts of data being transfered between being the client and server
@Turnerj Turnerj added enhancement Enhancements & features moderate-change Moderate changes required labels Aug 14, 2020
This was only used by the EntityBucketStagingCollection
@Turnerj Turnerj merged commit 3318983 into master Aug 14, 2020
@Turnerj Turnerj deleted the bucket-perf-improvements branch August 14, 2020 08:05
@Turnerj Turnerj added this to the 1.0.0 milestone Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements & features moderate-change Moderate changes required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant